home *** CD-ROM | disk | FTP | other *** search
Wrap
iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg((((3333)))) IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg((((3333)))) NNNNAAAAMMMMEEEE iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg - class to implement image data caching in main memory IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM ilLink : ilImage : ilCacheImg HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE #include <il/ilCdefs.h> CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN ilMemCacheImg implements memory caching for two different types of image data: files and operators. For image files, the cache stores raw or uncompressed data. If the image is stored by rows, the cache is allocated by rows matching those in the file. If the files are stored in rectangular chunks, the cache is allocated in pieces that are the size and shape of the chunks. For image operators, the cache stores the processed results. A cache image stores its data in fixed-size rectangles called _p_a_g_e_s. A _t_i_l_e is an arbitrary rectangle of image data, which usually spans multiple pages. The image access functions (iiiillllGGGGeeeettttTTTTiiiilllleeee(((()))) and iiiillllSSSSeeeettttTTTTiiiilllleeee(((()))) and their variants) allow arbitrary access to any contiguous rectangle of image data. Because these accesses usually do not match the underlying storage format, ilMemCacheImg performs any necessary reformatting of the image data. UUUUssssiiiinnnngggg iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg Like ilImage, ilMemCacheImg is an abstract class, requiring further derivation to be used as an object. The virtuals inherited from ilImage, iiiillllQQQQGGGGeeeettttTTTTiiiilllleeee3333DDDD(((()))) and iiiillllQQQQSSSSeeeettttTTTTiiiilllleeee3333DDDD(((()))), along with iiiillllQQQQFFFFiiiillllllllTTTTiiiilllleeee3333DDDD(((()))) and iiiillllQQQQCCCCooooppppyyyyTTTTiiiilllleeeeCCCCffffgggg(((()))), are all implemented by this class. These functions provide the necessary conversion from the data pages in the cache to the user's tile requests. The virtual methods hhhhaaaassssPPPPaaaaggggeeeessss(((()))), qqqqLLLLoooocccckkkkPPPPaaaaggggeeeeSSSSeeeetttt(((()))) and uuuunnnnlllloooocccckkkkPPPPaaaaggggeeeeSSSSeeeetttt(((()))), inherited from ilImage, are also implemented by this class, hiding the ilImage implementations. qqqqLLLLoooocccckkkkPPPPaaaaggggeeeeSSSSeeeetttt(((()))) locks the specified pages in the cache and, if necessary, waits until the data is read into the cache. uuuunnnnlllloooocccckkkkPPPPaaaaggggeeeeSSSSeeeetttt(((()))) removes the lock on the specified pages (See also the iiiillllTTTTiiiilllleeeeIIIImmmmggggIIIItttteeeerrrr man page). PPPPaaaaggggeeee 1111 iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg((((3333)))) IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg((((3333)))) hhhhaaaassssPPPPaaaaggggeeeessss(((()))) returns TRUE since this class uses the paging mechanism. Additionally, the virtuals ggggeeeettttCCCCaaaacccchhhheeeeSSSSiiiizzzzeeee(((()))) and fffflllluuuusssshhhh(((()))), inherited from ilCacheImg, are implemented by this class. ggggeeeettttCCCCaaaacccchhhheeeeSSSSiiiizzzzeeee(((()))) returns the cache (byte) size by multiplying the number of pages resident in cache times the object's page size. The fffflllluuuusssshhhh(((()))) function causes modified pages in cache to be written out from main memory to backing store, and optionally discards any resident pages. Most of the details of page management are implemented by the helper class, ilPager; see the man page for that class for more information on the paging scheme. MMMMoooonnnniiiittttoooorrrriiiinnnngggg tttthhhheeee ccccaaaacccchhhheeee You can watch for cache thrashing (wasted re-calculation of the same page) if you enable monitoring with either sssseeeettttGGGGlllloooobbbbaaaallllTTTThhhhrrrraaaasssshhhhMMMMooooddddeeee() or sssseeeettttTTTThhhhrrrraaaasssshhhhMMMMooooddddeeee(). You can get the time spent thrashing with ggggeeeettttTTTThhhhrrrraaaasssshhhhTTTTiiiimmmmeeee(). The average time spent computing a page can be obtained with ggggeeeettttPPPPaaaaggggeeeeTTTTiiiimmmmeeee() while the total time spent computing pages for an image is returned with ggggeeeettttTTTToooottttaaaallllPPPPaaaaggggeeeeTTTTiiiimmmmeeee(). CCCCoooonnnnttttrrrroooolllllllliiiinnnngggg tttthhhheeee ccccaaaacccchhhheeee Various functions inherited from ilImage (for example, iiiillllGGGGeeeettttPPPPaaaaggggeeeeSSSSiiiizzzzeeee(((()))), iiiillllSSSSeeeettttPPPPaaaaggggeeeeSSSSiiiizzzzeeee(((())))), and the global routines, iiiillllSSSSeeeettttMMMMaaaaxxxxCCCCaaaacccchhhheeeeSSSSiiiizzzzeeee(((()))), iiiillllSSSSeeeettttMMMMaaaaxxxxCCCCaaaacccchhhheeeeFFFFrrrraaaaccccttttiiiioooonnnn(((()))), iiiillllGGGGeeeettttMMMMaaaaxxxxCCCCaaaacccchhhheeeeSSSSiiiizzzzeeee(((()))), iiiillllGGGGeeeettttCCCCuuuurrrrCCCCaaaacccchhhheeeeSSSSiiiizzzzeeee(((()))), iiiillllGGGGeeeettttMMMMaaaaxxxxCCCCaaaacccchhhheeeeFFFFrrrraaaaccccttttiiiioooonnnn(((()))), can be used to control the operation of the cache. CCCCLLLLAAAASSSSSSSS MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN SSSSUUUUMMMMMMMMAAAARRRRYYYY CCCCoooonnnnttttrrrroooolllllllliiiinnnngggg MMMMuuuullllttttiiii----TTTThhhhrrrreeeeaaaaddddiiiinnnngggg void ilMemCacheImgEnableMP(ilMemCacheImg *obj, int on) int ilMemCacheImgIsMPenabled(ilMemCacheImg *obj) PPPPaaaaggggeeee ttttiiiimmmmiiiinnnngggg float ilMemCacheImgGetPageTime(ilMemCacheImg *obj) float ilMemCacheImgGetTotalPageTime(ilMemCacheImg *obj) void ilMemCacheImgSetRetainMode(ilMemCacheImg *obj, ilCacheRetainMode mode) ilCacheRetainMode ilMemCacheImgGetRetainMode(ilMemCacheImg *obj) void ilMemCacheImgSetThrashMode(ilMemCacheImg *obj, ilCacheThrashMode mode) ilCacheThrashMode ilMemCacheImgGetThrashMode(ilMemCacheImg *obj) float ilMemCacheImgGetThrashTime(ilMemCacheImg *obj) RRRReeeeqqqquuuueeeesssstttt pppprrrroooocccceeeessssssssiiiinnnngggg MMMMeeeemmmmoooorrrryyyy mmmmaaaannnnaaaaggggeeeemmmmeeeennnntttt PPPPaaaaggggeeee 2222 iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg((((3333)))) IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg((((3333)))) FUNCTION DESCRIPTIONS eeeennnnaaaabbbblllleeeeMMMMPPPP(((()))) void ilMemCacheImgEnableMP(ilMemCacheImg *obj, int on) This function can be used to enable or diasable multi-threading of the processing requests for this object. If the _o_n parameter is TRUE, multi-threading will be enabled, otherwise it will be disabled. ggggeeeettttPPPPaaaaggggeeeeTTTTiiiimmmmeeee(((()))) float ilMemCacheImgGetPageTime(ilMemCacheImg *obj) Thie method returs the average time to compute a page in the cache (includes time to computing parent image pages). ggggeeeettttRRRReeeettttaaaaiiiinnnnMMMMooooddddeeee(((()))) ilCacheRetainMode ilMemCacheImgGetRetainMode(ilMemCacheImg *obj) The method returns the page retention mode as set by sssseeeettttRRRReeeettttaaaaiiiinnnnMMMMooooddddeeee(). ilCacheThrashMode ilMemCacheImgGetThrashMode(ilMemCacheImg *obj) This method returns the thrash mode set with sssseeeettttTTTThhhhrrrraaaasssshhhhMMMMooooddddeeee() or sssseeeettttGGGGlllloooobbbbaaaallllTTTThhhhrrrraaaasssshhhhMMMMooooddddeeee(). ggggeeeettttTTTThhhhrrrraaaasssshhhhTTTTiiiimmmmeeee(((()))) float ilMemCacheImgGetThrashTime(ilMemCacheImg *obj) This method returns the total time spent redundantly re-computing or re-loading pages for this image (since the last reset) as as result of cache thrashing. This info is only available if enabled with sssseeeettttTTTThhhhrrrraaaasssshhhhMMMMooooddddeeee() or sssseeeettttGGGGlllloooobbbbaaaallllTTTThhhhrrrraaaasssshhhhMMMMooooddddeeee(). ggggeeeettttTTTToooottttaaaallllPPPPaaaaggggeeeeTTTTiiiimmmmeeee(((()))) float ilMemCacheImgGetTotalPageTime(ilMemCacheImg *obj) This method returns the total time spent computing or loading pages for this image (since the last reset). PPPPaaaaggggeeee 3333 iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg((((3333)))) IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg((((3333)))) iiiissssMMMMPPPPeeeennnnaaaabbbblllleeeedddd(((()))) int ilMemCacheImgIsMPenabled(ilMemCacheImg *obj) This function can be used to determine if multi-threading of the page requests for this object is enabled. If the returned value is TRUE, multi-threading is enabled, otherwise it is disabled. sssseeeettttRRRReeeettttaaaaiiiinnnnMMMMooooddddeeee(((()))) void ilMemCacheImgSetRetainMode(ilMemCacheImg *obj, ilCacheRetainMode mode) This method sets the page retention mode. The mode can have one of the two following values: ilCacheRetainOff Don't save unmodified cache pages when they must be discarded because the cache is full. This is the default mode. ilCacheRetainOn Keep pages for this image in a temporary file when they must be removed from the cache because the cache is full. These pages will be read from the temporary file rather than being recomputed if they are needed again later. void ilMemCacheImgSetThrashMode(ilMemCacheImg *obj, ilCacheThrashMode mode) This method sets the thrash mode for this object. The thrash mode can have one of the values described in sssseeeettttGGGGlllloooobbbbaaaallllTTTThhhhrrrraaaasssshhhhMMMMooooddddeeee(). IIIINNNNHHHHEEEERRRRIIIITTTTEEEEDDDD MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm iiiillllCCCCaaaacccchhhheeeeIIIImmmmgggg ilCacheImgFlush(), ilCacheImgGetCacheSize() IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm iiiillllIIIImmmmaaaaggggeeee ilAddInput(), ilAllocFillData(), ilClipTile(), ilClipTileAsTile(), ilClipTileFloat(), ilClipTileFloatAsTile(), ilConfigureRetainedCacheImage(), ilCopy(), ilCopyTile(), ilCopyTile3D(), ilCopyTileCfg(), ilFillTile(), ilFillTile3D(), ilFillTileRGB(), ilFreeFillData(), ilGetColorImg(), ilGetColorModel(), ilGetColormap(), ilGetColormapPtr(), ilGetCompression(), ilGetConfig(), ilGetCsize(), ilGetDataType(), ilGetDimensions(), ilGetDirectInput(), ilGetDisplayCacheEnable(), ilGetFill(), ilGetFillData(), ilGetFillValue(), ilGetHeight(), ilGetHwEnable(), ilGetHwHint(), ilGetHwHintName(), ilGetHwIntHint(), ilGetHwIntHintName(), ilGetInput(), ilGetInputTileRequirement(), ilGetLockTileSet(), ilGetMappedPageSize(), ilGetMappedSize(), ilGetMaxColormapLevels(), ilGetMaxValue(), PPPPaaaaggggeeee 4444 iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg((((3333)))) IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg((((3333)))) ilGetMinValue(), ilGetNumChans(), ilGetNumInputs(), ilGetOrder(), ilGetOrientation(), ilGetPageBorder(), ilGetPageBorderPtr(), ilGetPageBorderX(), ilGetPageBorderY(), ilGetPageBorderZ(), ilGetPageCounts(), ilGetPageDelta(), ilGetPageDeltaStruct(), ilGetPageDimensions(), ilGetPageIndices(), ilGetPageOrigin(), ilGetPageOriginC(), ilGetPageOriginStruct(), ilGetPageOriginX(), ilGetPageOriginY(), ilGetPageOriginZ(), ilGetPageSize(), ilGetPageSizeBytes(), ilGetPageSizeC(), ilGetPageSizePix(), ilGetPageSizeStruct(), ilGetPageSizeVal(), ilGetPageSizeX(), ilGetPageSizeXY(), ilGetPageSizeY(), ilGetPageSizeZ(), ilGetPixel(), ilGetPixel3D(), ilGetPriority(), ilGetScaleMax(), ilGetScaleMin(), ilGetSize(), ilGetSizePtr(), ilGetStrides(), ilGetSubTile(), ilGetSubTile3D(), ilGetTile(), ilGetTile3D(), ilGetWidth(), ilGetXsize(), ilGetYsize(), ilGetZsize(), ilHasPageBorder(), ilHasPages(), ilInitScaleMinMax(), ilIsColorImg(), ilIsIntegral(), ilIsMirrorOrientation(), ilIsSigned(), ilIsWritable(), ilLockPage(), ilLockPageSet(), ilLockTile(), ilLockTile3D(), ilMapFlipTrans(), ilMapFromInput(), ilMapFromInput2D(), ilMapFromInput3D(), ilMapFromSource(), ilMapFromSource2D(), ilMapFromSource3D(), ilMapOrientation(), ilMapSize(), ilMapTile(), ilMapTileFlipTrans(), ilMapTileFloat(), ilMapToInput(), ilMapToInput2D(), ilMapToInput3D(), ilMapToSource(), ilMapToSource2D(), ilMapToSource3D(), ilMapXY(), ilMapXYFloat(), ilMapXYSign(), ilQCopyTileCfg(), ilQFillTile3D(), ilQFillTileRGB(), ilQGetSubTile3D(), ilQGetTile3D(), ilQLockPageSet(), ilQSetSubTile3D(), ilQSetTile3D(), ilRemoveHwHint(), ilRemoveHwHintName(), ilRemoveInput(), ilSetColorModel(), ilSetColormap(), ilSetCompression(), ilSetCsize(), ilSetDataType(), ilSetDisplayCacheEnable(), ilSetFill(), ilSetFillValue(), ilSetHwEnable(), ilSetHwHint(), ilSetHwIntHint(), ilSetHwIntHintName(), ilSetInput(), ilSetMaxColormapLevels(), ilSetMaxValue(), ilSetMinValue(), ilSetNumChans(), ilSetOrder(), ilSetOrientation(), ilSetPageBorder(), ilSetPageBorderStruct(), ilSetPageSize(), ilSetPageSizeC(), ilSetPageSizeStruct(), ilSetPageSizeXY(), ilSetPageSizeZ(), ilSetPixel(), ilSetPixel3D(), ilSetPriority(), ilSetScaleMinMax(), ilSetScaleType(), ilSetSize(), ilSetSubTile(), ilSetSubTile3D(), ilSetTile(), ilSetTile3D(), ilSetXYsize(), ilSetXsize(), ilSetYsize(), ilSetZsize(), ilUnlockPage(), ilUnlockPageSet() IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm iiiillllLLLLiiiinnnnkkkk ilLinkClearSet(), ilLinkClearStatus(), ilLinkGetDescription(), ilLinkGetDirectParent(), ilLinkGetDisabledIndex(), ilLinkGetFloatProp(), ilLinkGetGenerationID(), ilLinkGetIntProp(), ilLinkGetNumChildren(), ilLinkGetNumParents(), ilLinkGetParent(), ilLinkGetPtrProp(), ilLinkGetRelatedChild(), ilLinkGetRelatedDelete(), ilLinkGetRelatedType(), ilLinkGetStatus(), ilLinkIsAllowed(), ilLinkIsAltered(), ilLinkIsEnabled(), ilLinkIsRelated(), ilLinkIsSet(), ilLinkRemoveParent(), ilLinkRemoveProp(), ilLinkSetDescription(), ilLinkSetDisabledIndex(), ilLinkSetEnabled(), ilLinkSetParent(), ilLinkSetProp(), ilLinkSetRelatedDelete(), ilLinkSetRelatedType() PPPPaaaaggggeeee 5555 iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg((((3333)))) IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll iiiillllMMMMeeeemmmmCCCCaaaacccchhhheeeeIIIImmmmgggg((((3333)))) SSSSEEEEEEEE AAAALLLLSSSSOOOO ilImage(3), ilCacheImg(3), ilFileImg(3), ilMondadicImg(3), ilPolyadi- cImg(3), ilSpatialImg(3), ilWarpImg(3), ilFPolyadicImg(3), ilTileIm- gIter(3) PPPPaaaaggggeeee 6666